package online.xuping.common;

import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.setting.Setting;

import java.util.List;

/**
 * 配置文件读取
 */
public class SettingUtil {
    /**
     * 从配置文件中读取文件，转化为list
     * @param filename
     * @param name
     * @return
     */
    public static List<String> getList(String filename, String name) {
        Setting setting = new Setting(filename , CharsetUtil.CHARSET_UTF_8, true);
        String restring = setting.getStr(name);
        return ListUtil.toList(restring.split(","));
    }
}
